﻿using System;

namespace UnityModule
{
    /// <summary>
    /// bundle配置信息，存储静态信息
    /// </summary>
//#if UNITY_IPHONE
    [Serializable]
//#else
//    [ProtoBuf.ProtoContract]
//#endif

    public class AssetBundleInfo
    {
        /// <summary>
        /// bundle名称带hashcode
        /// </summary>
//#if !UNITY_IPHONE
//        [ProtoBuf.ProtoMember(1)]
//#endif
        public string abNameWithHash;
        /// <summary>
        /// 依赖
        /// </summary>
//#if !UNITY_IPHONE
//        [ProtoBuf.ProtoMember(2)]
//#endif
        public string[] de;
        /// <summary>
        /// 文件大小
        /// </summary>
//#if !UNITY_IPHONE
//        [ProtoBuf.ProtoMember(3)]
//#endif
        public long fs;
        /// <summary>
        /// 路径：0: 激活下载, 1: 后台下载,2 已在StreamingAsset 中
        /// 这个字段更新时候初始化
        /// </summary>
        public byte pathType = 0;

        /// <summary>
        /// 下载优先级
        /// </summary>
        public int priority;
    }

    [Serializable]
    public class AssetBundleInfoV2 : AssetBundleInfo {

        public byte[] md5;
        /// <summary>
        /// 断点续传
        /// </summary>
        public byte breakpoint;

        public long offsetBegin;
        public long offsetEnd;
    }
    public enum AssetBundleInfoPathType
    {
        PreDownload = 0,
        Background,
    }
}
